package(default_visibility = ["//:__subpackages__"])

licenses(["notice"])

cc_library(
    name = "gcp_kms_aead",
    srcs = ["gcp_kms_aead.cc"],
    hdrs = ["gcp_kms_aead.h"],
    include_prefix = "tink/integration/gcpkms",
    visibility = ["//visibility:public"],
    deps = [
        "@com_github_grpc_grpc//:grpc++",
        "@com_google_absl//absl/status",
        "@com_google_googleapis//google/cloud/kms/v1:kms_cc_grpc",
        "@tink_cc//:aead",
        "@tink_cc//util:status",
        "@tink_cc//util:statusor",
    ],
)

cc_library(
    name = "gcp_kms_client",
    srcs = ["gcp_kms_client.cc"],
    hdrs = ["gcp_kms_client.h"],
    include_prefix = "tink/integration/gcpkms",
    visibility = ["//visibility:public"],
    deps = [
        ":gcp_kms_aead",
        "@com_github_grpc_grpc//:grpc++",
        "@com_google_absl//absl/status",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/synchronization",
        "@tink_cc//:aead",
        "@tink_cc//:kms_client",
        "@tink_cc//:kms_clients",
        "@tink_cc//:version",
        "@tink_cc//util:status",
        "@tink_cc//util:statusor",
    ],
)

# tests

cc_test(
    name = "gcp_kms_aead_test",
    size = "medium",
    srcs = ["gcp_kms_aead_test.cc"],
    deps = [
        ":gcp_kms_aead",
        "@com_google_googletest//:gtest_main",
        "@tink_cc//util:status",
        "@tink_cc//util:statusor",
    ],
)

cc_test(
    name = "gcp_kms_client_test",
    size = "medium",
    srcs = ["gcp_kms_client_test.cc"],
    data = ["//testdata/gcp:credentials"],
    deps = [
        ":gcp_kms_client",
        "@com_google_absl//absl/status",
        "@com_google_googletest//:gtest_main",
        "@tink_cc//util:status",
        "@tink_cc//util:statusor",
        "@tink_cc//util:test_matchers",
        "@tink_cc//util:test_util",
    ],
)
